Skip to content

Generate 3.18.0 types#34

Merged
predragnikolic merged 1 commit intomainfrom
generate-lsp-3-18-0
Apr 4, 2026
Merged

Generate 3.18.0 types#34
predragnikolic merged 1 commit intomainfrom
generate-lsp-3-18-0

Conversation

@predragnikolic
Copy link
Copy Markdown
Member

@predragnikolic predragnikolic commented Apr 3, 2026

This PR brings 3.18 LSP types.

I had the false impression that the latest changes to metaModel.json file are done at microsoft/vscode-languageserver-node, but actually the latest chnages are done at microsoft/language-server-protocol,
so I updated the download script to point to microsoft/language-server-protocol

I also manually edited lsp.json to add diagnostic message union string MarkupContent
until they fix it upstream.

As Janos noticed they have added the type in microsoft/language-server-protocol@df7c77b
and later removed it in microsoft/language-server-protocol@7e1b69d (I have asked them if this was a mistake)

I manually edited lsp.json to add diagnostic message union string MarkupContent
class ColorPresentationResponse(TypedDict):
method: Literal['textDocument/colorPresentation']
result: List['ColorPresentation']
result: Union[List['ColorPresentation'], None]
Copy link
Copy Markdown
Member

@rchl rchl Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem to match https://microsoft.github.io/language-server-protocol/specifications/lsp/3.18/specification/#textDocument_colorPresentation and also it would be a breaking change.

EDIT: I suppose breaking changes like that are allowed in new spec versions. Technically those should already be guarded by capability.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will assume that someone forgot to update the html version of the spec.

Copy link
Copy Markdown
Member

@jwortmann jwortmann Apr 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There was a discussion about that in microsoft/language-server-protocol#2235 with some backlash due to it being a breaking change.

But even if it ends up in the specs, our code should be fine because we already handle this case:
https://github.com/sublimelsp/LSP/blob/40c9fe32ad0d4edf084e19b21e71505796c12dcd/plugin/color.py#L32-L34

https://github.com/sublimelsp/LSP/blob/40c9fe32ad0d4edf084e19b21e71505796c12dcd/plugin/session_buffer.py#L570-L571

Copy link
Copy Markdown
Member

@jwortmann jwortmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the false impression that the latest changes to metaModel.json file are done at microsoft/vscode-languageserver-node, but actually the latest chnages are done at microsoft/language-server-protocol,

According to microsoft/language-server-protocol#2235 (comment) changes often get ported from microsoft/vscode-languageserver-node to microsoft/language-server-protocol. But it also seems more appropriate to me to use microsoft/language-server-protocol as the source for the metaModel.json file, because that is the official specs repo, so in theory that should increase the probability that the metaModel.json matches the specs documentation.

@predragnikolic predragnikolic merged commit 18ef625 into main Apr 4, 2026
1 check passed
@predragnikolic predragnikolic deleted the generate-lsp-3-18-0 branch April 4, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants